void setup() {
Serial.begin(9600); // open serial port and set data rate to 9600 bps
Serial.println("Thermistor temperature measurement:");
Serial.println("\n Vo Rt T (C)");
}

int ThermistorPin = 1; // Analog input pin for thermistor voltage
int Vo; // Integer value of voltage reading
float R = 10000.0; // Fixed resistance in the voltage divider
float logRt,Rt,T;
float a = 1.132230e-03, b = 2.191926e-04, c=1.143152e-07, d = -6.081209e-07;


// -- loop() is repeated indefinitely
void loop() {
Vo = analogRead(ThermistorPin);Rt = R*( 1023.0 / (float)Vo - 1.0 );
logRt = log(Rt);
T = ( 1.0 / (a + b*logRt + c*logRt*logRt*logRt + d*logRt*logRt ) ) - 273.15;
Serial.print(" "); Serial.print(Vo);
Serial.print(" "); Serial.print(Rt);
Serial.print(" "); Serial.println(T);
delay(300);
}
